
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
#define int long long
int n;
string a , b;
void solve()
{
	int n; cin >> n;
	vector<int>ret( n+ 1 );
	int sum = 0;
	for( int i = 1 ;i <= n ;i++ )cin >> ret[i] , sum += ret[i];
	sort( ret.begin() + 1 , ret.end() );
	vector<int> ans1 , ans2;
	for( int i = 1 ; i <= n ; i++ )
	{
	    if( ret[i] & 1 ) ans1.push_back(ret[i]);
	    else ans2.push_back(ret[i]);
	}
	if(ans1.size() == 0 ) cout << ans2.back() << endl;
	else if( ans2.size() == 0 ) cout << ans1.back() << endl;
	else
	{
	    cout << sum - ( ans1.size() -1 ) << endl;
	}
}
signed main()
{
    int t; cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}